<%@page import="com.dao.impl.ColumnDaoImpl"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"
	isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'manager_root.jsp' starting page</title>
<link rel="stylesheet"
	href="${pageContext.request.contextPath }/assets/css/bootstrap.min.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath }/assets/vendor/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath }/assets/vendor/linearicons/style.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath }/assets/vendor/chartist/css/chartist-custom.css">
<!-- MAIN CSS -->
<link rel="stylesheet"
	href="${pageContext.request.contextPath }/assets/css/main.css">
<!-- FOR DEMO PURPOSES ONLY. You should remove this in your project -->
<link rel="stylesheet"
	href="${pageContext.request.contextPath }/assets/css/demo.css">
<!-- GOOGLE FONTS -->
<!-- ICONS -->
<link rel="apple-touch-icon" sizes="76x76"
	href="${pageContext.request.contextPath }/assets/img/apple-icon.png">
<link rel="icon" type="image/png" sizes="96x96"
	href="${pageContext.request.contextPath }/assets/img/favicon.png">
</head>
<%
	pageContext.setAttribute("fbip",
			new ColumnDaoImpl().findListByPidIsNull());
%>
<body>
	<c:set var="roottype" value="root"></c:set>
	<c:set var="editortype" value="editor"></c:set>
	<div id="wrapper">
		<jsp:include page="top.jsp"></jsp:include>
		<c:choose>
			<c:when test="${sessionScope.Manager.utype == pageScope.roottype}">
				<jsp:include page="leftroot.jsp"></jsp:include>
			</c:when>
			<c:when test="${sessionScope.Manager.utype == pageScope.editortype}">
				<jsp:include page="lefteditor.jsp"></jsp:include>
			</c:when>
		</c:choose>
		<div class="main">
			<div class="container">
				<div class="row text-center">
					<ul id="myTab" class="nav nav-tabs">
						<li class=""><a
							href="${pageContext.request.contextPath }/manage/ShowColumnQuery.do?
						querytype=all">
								查询所有栏目</a></li>
						<li class="dropdown"><a href="#" id="myTabDrop1"
							class="dropdown-toggle" data-toggle="dropdown"> 栏目查询 <b
								class="caret"></b></a>
							<ul class="dropdown-menu" role="menu"
								aria-labelledby="myTabDrop1">
								<li><a href="#ejb" tabindex="-1" data-toggle="tab">栏目类别查询</a></li>
							</ul></li>
					</ul>
					<div id="myTabContent" class="tab-content">

						
						<div class="tab-pane fade" id="ejb">
							<form class="navbar-form navbar-left" role="form"
								action="${pageContext.request.contextPath }/manage/ShowColumnQuery.do?
						querytype=type"
								method="post">
								<div class="input-group">
									<select class="form-control " name="type">
										<c:forEach var="fb" items="${fbip }">
											<option value="${fb.ctype }">${fb.ctype }</option>
										</c:forEach>
									</select><span class="input-group-btn"><button type="submit"
											class="btn btn-primary">查询</button></span>
								</div>
							</form>
						</div>
					</div>
				</div>
				<c:if test="${!empty requestScope.lc }">
					<div class="table-responsive">
						<table class=" table table-hover ">
							<caption></caption>
							<thead>
								<tr>
									<th>栏目名</th>
									<th>栏目类型</th>
									<th>栏目排序</th>
									<th>栏目状态</th>
									<th>用户操作</th>
								</tr>
							</thead>
							<tbody>
								<c:forEach items="${requestScope.lc }" var="p">
									<tr>
										<td>${p.cname }</td>
										<td>${p.ctype }</td>
										<td>${p.corder }</td>
										<td>${p.cup }</td>
										<td><a
											href="${pageContext.request.contextPath }/manage/UpdateAndDeleteColumnServlet.do?actiontype=update&cid=${p.cid}&querytype=${querytype}"
											class="btn btn-warning btn-sm" role="button">修改栏目</a>
											<c:choose>
												<c:when test="${p.cup == 1 }">
													<a href="${pageContext.request.contextPath }/manage/UpdateAndDeleteColumnServlet.do?actiontype=cup&cup=${p.cup}&cid=${p.cid}&querytype=${querytype}&type=${p.ctype}" class="btn btn-danger btn-sm" role="button">销毁栏目</a>
												</c:when>
												<c:when test="${p.cup == 0 }">
													<a href="${pageContext.request.contextPath }/manage/UpdateAndDeleteColumnServlet.do?actiontype=cup&cup=${p.cup}&cid=${p.cid}&querytype=${querytype}&type=${p.ctype}" class="btn btn-success btn-sm" role="button">激活栏目</a>
												</c:when>
											</c:choose>
											</a>
										</td>
									</tr>
								</c:forEach>
							</tbody>
						</table>
					</div>
				</c:if>
			</div>
		</div>
	</div>
	<script
		src="${pageContext.request.contextPath }/assets/vendor/jquery/jquery.min.js"></script>
	<script
		src="${pageContext.request.contextPath }/assets/vendor/bootstrap/js/bootstrap.min.js"></script>
	<script
		src="${pageContext.request.contextPath }/assets/vendor/jquery-slimscroll/jquery.slimscroll.min.js"></script>
	<script
		src="${pageContext.request.contextPath }/assets/vendor/jquery.easy-pie-chart/jquery.easypiechart.min.js"></script>
	<script
		src="${pageContext.request.contextPath }/assets/vendor/chartist/js/chartist.min.js"></script>
	<script
		src="${pageContext.request.contextPath }/assets/scripts/klorofil-common.js"></script>
</body>
</html>
